/*
 * Lenovo Group
 * Copyright (c) 2015-2016 All Rights Reserved.
 * 
 * Project Name:assign-tracer
 * Create Time: 2016年1月21日 下午3:17:47
 */
package com.lenovo.lmrp.server.assigntracer.util.pusher;

import java.util.Arrays;
import java.util.List;

import com.lenovo.lmrp.api.constant.SendType;

/**
 * @author songyz 发送消息的参数
 */
public class PushParameter {

	/**
	 * 个推的构造函数
	 * 
	 * @param uuid
	 * @param cid
	 * @param title
	 * @param content
	 * @param desc
	 * @param getuiType
	 */
	public PushParameter(String engineerId, String itsmcode, String uuid, String cid, String title, String content,
			String desc, int getuiType) {
		this.uuid = uuid;
		this.engineerId = engineerId;
		this.itsmcode = itsmcode;
		this.cId = cid;
		this.title = title;
		this.content = content;
		this.desc = desc;
		this.getuiType = getuiType;
		this.sendType = SendType.GETUI;
	}

	/**
	 * 短信的构造函数
	 * 
	 * @param uuid
	 * @param mobile
	 * @param content
	 */
	public PushParameter(String engineerId, String itsmcode, String uuid, String mobile, String content) {
		this.uuid = uuid;
		this.engineerId = engineerId;
		this.itsmcode = itsmcode;
		this.content = content;
		this.mobile = mobile;
		this.sendType = SendType.SMS;
	}

	/**
	 * 邮件构造函数
	 * 
	 * @param uuid
	 * @param addr
	 * @param title
	 * @param content
	 */
	public PushParameter(String engineerId, String itsmcode, String uuid, String addr, String title, String content) {
		this.uuid = uuid;
		this.engineerId = engineerId;
		this.itsmcode = itsmcode;
		this.title = title;
		this.content = content;
		this.sendType = SendType.EMAIL;
		setEmailAddress(addr);
	}

	public PushParameter() {
	}

	private String uuid;// 跟Cache进行同步使用
	private String itsmcode;
	private String engineerId;

	private String cId;
	private String mobile;
	private List<String> emailAddress;
	private String openId;

	private SendType sendType;

	private String title;
	private String content;
	private int getuiType;
	private String desc;

	public String getDesc() {
		return desc;
	}

	public PushParameter setDesc(String desc) {
		this.desc = desc;
		return this;
	}

	public int getGetuiType() {
		return getuiType;
	}

	public PushParameter setGetuiType(int getuiType) {
		this.getuiType = getuiType;
		return this;
	}

	public String getcId() {
		return cId;
	}

	public PushParameter setcId(String cId) {
		this.cId = cId;
		return this;
	}

	public String getMobile() {
		return mobile;
	}

	public PushParameter setMobile(String mobile) {
		this.mobile = mobile;
		return this;
	}

	public List<String> getEmailAddress() {
		return emailAddress;
	}

	public String getItsmcode() {
		return itsmcode;
	}

	public void setItsmcode(String itsmcode) {
		this.itsmcode = itsmcode;
	}

	public String getEngineerId() {
		return engineerId;
	}

	public void setEngineerId(String engineerId) {
		this.engineerId = engineerId;
	}

	public PushParameter setEmailAddress(List<String> emailAddress) {
		this.emailAddress = emailAddress;
		return this;
	}

	public PushParameter setEmailAddress(String... emailAddress) {
		this.emailAddress = Arrays.asList(emailAddress);
		return this;
	}

	public String getOpenId() {
		return openId;
	}

	public PushParameter setOpenId(String openId) {
		this.openId = openId;
		return this;
	}

	public SendType getSendType() {
		return sendType;
	}

	public PushParameter setSendType(SendType sendType) {
		this.sendType = sendType;
		return this;
	}

	public String getTitle() {
		return title;
	}

	public PushParameter setTitle(String title) {
		this.title = title;
		return this;
	}

	public String getContent() {
		return content;
	}

	public PushParameter setContent(String content) {
		this.content = content;
		return this;

	}

	public String getUuid() {
		return uuid;
	}

	public PushParameter setUuid(String uuid) {
		this.uuid = uuid;
		return this;
	}

}
